<template>
  <div class="loginstyle">
    <transition name="el-zoom-in-center">
        <div v-show="show" class="transition-box">
          <div class="login">登录</div>
          <el-form ref="form" :model="fromMessage" label-width="40px">
            <el-form-item label="账号">
             <el-input v-model="fromMessage.name" placeholder="请输入账号"></el-input>
            </el-form-item>
            <el-form-item label="密码">
             <el-input v-model="fromMessage.password" placeholder="请输入密码"></el-input>
            </el-form-item>
          </el-form>
          <loadingbtn
          :content="content"
          @btnajaxfunc="btnajaxfunc"
         ></loadingbtn>
         <!-- <el-button @click="func">登录</el-button> -->
         <div @click="()=>{this.$router.push('./register')}" class="reStyle">注册</div>
        </div>
      </transition>
  </div>
</template>

<script>
import Loadingbtn from '@/components/Loadingbtn'
export default {
  name: 'login',
  components: {
    Loadingbtn
  },
  data () {
    return {
      content: {
        text: '登录',
        style: {width: '90%',height:'40px'}
      },
      show: true,
      value: {},
      fromMessage: {}
    }
  },
  methods: {
    btnajaxfunc (value) {
      console.log(11, value)
      this.show = false
      this.value = value
    },
    func(){
      console.log(111)
      this.$axios.get('http://api.cat-shop.penkuoer.com/api/v1/products',{
        parmas:{
          pages:3,
          per:2
        },
        headers:{}
      }).then(res=>{
        coonsole.log(res)
      })
    }
  },
  created(){
    console.log(this.$axios,this)
  }
}
</script>

<style lang="less" scoped>
.loginstyle{
  width: 100%;
  height: 100%;
  // background-color: red;
  background: url('../assets/2.jpg');
  background-size: 100% 100%;
}
  .transition-box {
    display: flex;
    flex-direction: column;
    // align-content: space-around;
    // flex-flow: wrap;
    justify-content: space-around;
    margin-bottom: 2.778vw;
    width: 27.778vw;
    height: 27.778vw;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    text-align: center;
    color: #fff;
    // padding: 40px 20px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin-right: 20px;
    // border: 1px solid rgba(226, 226, 226, 0.5);
    position: absolute;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    .login{
      font-size: 33px;
    letter-spacing: 27px;
    }
   .el-form{
      width: 90%;
      // background: aqua;
      margin: 0 auto;
      .el-form-item{
        // background-color: red;
        .el-form-item__label{
          background-color: blue;
      text-align: center;
      }
      }
      }
  }
  .reStyle{
    width: 100px;
    height: 40px;
    color: blue;
    font-size: 13px;
    position: absolute;
    bottom: 20%;
    right: 5%;
  }

</style>
